﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace MyERP.Models
{
    /// <summary>
    /// 用户实体类
    /// </summary>
    public class Users
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string PhoneNumber { get; set; }
        public string Password { get; set; }
        /// <summary>
        /// 首页权限
        /// </summary>
        public int q1 { get; set; }
        /// <summary>
        /// 采购权限
        /// </summary>
        public int q2 { get; set; }
        /// <summary>
        /// 销售权限
        /// </summary>
        public int q3 { get; set; }
        /// <summary>
        /// 收支权限
        /// </summary>
        public int q4 { get; set; }
    }
    public class UsersConfig : IEntityTypeConfiguration<Users>
    {
        public void Configure(EntityTypeBuilder<Users> builder)
        {
            builder.ToTable("T_Users");
            builder.Property(e => e.Name).HasMaxLength(20);
            builder.Property(e => e.PhoneNumber).HasMaxLength(20);
            builder.Property(e => e.Password).HasMaxLength(30);
        }
    }
}
